package response

import (
	"sync"
	"wzgames/internal/model/aviatorp"
)

var opMultiplierPool *sync.Pool

// 小飞机赔率播报池

func InitAvtMultiPacketPool() {
	opMultiplierPool = &sync.Pool{
		New: func() interface{} {
			return &aviatorp.CurrentMultiplier{}
		},
	}
}

func AcquireAvtMulti() *aviatorp.CurrentMultiplier {
	return opMultiplierPool.Get().(*aviatorp.CurrentMultiplier)
}

func ReleaseAvtMulti(value *aviatorp.CurrentMultiplier) {
	value.Crash = false
	opMultiplierPool.Put(value)
}

var opAvtBetPool *sync.Pool

// 小飞机投注池

func InitAvtBetPool() {
	opAvtBetPool = &sync.Pool{
		New: func() interface{} {
			return &aviatorp.BetNote{}
		},
	}
}

func AcquireAvtBet() *aviatorp.BetNote {
	return opAvtBetPool.Get().(*aviatorp.BetNote)
}

func ReleaseAvtBet(value *aviatorp.BetNote) {
	value.Op = 0
	opAvtBetPool.Put(value)
}
